﻿using System;
using System.Windows.Forms;
using YJKRevitBase.WinForm.WinFormRemindSuit;
using YJKCopyModel.Forms;

namespace YJKCopyModel.Models
{
	public class LastModelControlInfoTransform : ICustomControlInfoTransform
	{
		public LastModelControlInfoTransform()
		{
		}

		public LastModelControlInfoTransform(string equipType)
		{
			this.m_EquipType = equipType;
		}

		public string GetControlStr(System.Windows.Forms.Control inputControl)
		{
			bool flag = this.m_EquipType == "给排水@消火栓" || this.m_EquipType == "给排水@灭火器";
			if (flag)
			{
				UCtrlHydrant uctrlHydrant = inputControl as UCtrlHydrant;
				bool flag2 = uctrlHydrant != null;
				if (flag2)
				{
					return uctrlHydrant.GetViewDatas();
				}
			}
			else
			{
				bool flag3 = this.m_EquipType == "暖通@风口";
				if (flag3)
				{
					UCtrlWindMouth uctrlWindMouth = inputControl as UCtrlWindMouth;
					bool flag4 = uctrlWindMouth != null;
					if (flag4)
					{
						return uctrlWindMouth.GetViewDatas();
					}
				}
				else
				{
					bool flag5 = this.m_EquipType == "暖通@风机盘管";
					if (flag5)
					{
						UCtrlDraughtFanPipe uctrlDraughtFanPipe = inputControl as UCtrlDraughtFanPipe;
						bool flag6 = uctrlDraughtFanPipe != null;
						if (flag6)
						{
							return uctrlDraughtFanPipe.GetViewDatas();
						}
					}
					else
					{
						bool flag7 = this.m_EquipType == "暖通@室内机";
						if (flag7)
						{
							UCtrlInDoorUnit uctrlInDoorUnit = inputControl as UCtrlInDoorUnit;
							bool flag8 = uctrlInDoorUnit != null;
							if (flag8)
							{
								return uctrlInDoorUnit.GetViewDatas();
							}
						}
						else
						{
							bool flag9 = this.m_EquipType == "暖通@散热器";
							if (flag9)
							{
								UCtrlRaditor uctrlRaditor = inputControl as UCtrlRaditor;
								bool flag10 = uctrlRaditor != null;
								if (flag10)
								{
									return uctrlRaditor.GetViewDatas();
								}
							}
							else
							{
								UCtrlElectric uctrlElectric = inputControl as UCtrlElectric;
								bool flag11 = uctrlElectric != null;
								if (flag11)
								{
									return uctrlElectric.GetViewDatas();
								}
							}
						}
					}
				}
			}
			return "";
		}

		public void SetControlStr(ref System.Windows.Forms.Control inputControl, string inputStr)
		{
			bool flag = this.m_EquipType == "给排水@消火栓" || this.m_EquipType == "给排水@灭火器";
			if (flag)
			{
				UCtrlHydrant uctrlHydrant = inputControl as UCtrlHydrant;
				bool flag2 = uctrlHydrant != null;
				if (flag2)
				{
					uctrlHydrant.SetViewDatas(inputStr);
				}
			}
			else
			{
				bool flag3 = this.m_EquipType == "暖通@风口";
				if (flag3)
				{
					UCtrlWindMouth uctrlWindMouth = inputControl as UCtrlWindMouth;
					bool flag4 = uctrlWindMouth != null;
					if (flag4)
					{
						uctrlWindMouth.SetViewDatas(inputStr);
					}
				}
				else
				{
					bool flag5 = this.m_EquipType == "暖通@风机盘管";
					if (flag5)
					{
						UCtrlDraughtFanPipe uctrlDraughtFanPipe = inputControl as UCtrlDraughtFanPipe;
						bool flag6 = uctrlDraughtFanPipe != null;
						if (flag6)
						{
							uctrlDraughtFanPipe.SetViewDatas(inputStr);
						}
					}
					else
					{
						bool flag7 = this.m_EquipType == "暖通@室内机";
						if (flag7)
						{
							UCtrlInDoorUnit uctrlInDoorUnit = inputControl as UCtrlInDoorUnit;
							bool flag8 = uctrlInDoorUnit != null;
							if (flag8)
							{
								uctrlInDoorUnit.SetViewDatas(inputStr);
							}
						}
						else
						{
							bool flag9 = this.m_EquipType == "暖通@散热器";
							if (flag9)
							{
								UCtrlRaditor uctrlRaditor = inputControl as UCtrlRaditor;
								bool flag10 = uctrlRaditor != null;
								if (flag10)
								{
									uctrlRaditor.SetViewDatas(inputStr);
								}
							}
							else
							{
								UCtrlElectric uctrlElectric = inputControl as UCtrlElectric;
								bool flag11 = uctrlElectric != null;
								if (flag11)
								{
									uctrlElectric.SetViewDatas(inputStr);
								}
							}
						}
					}
				}
			}
		}

		public string m_EquipType = string.Empty;
	}
}
